package chinese.admin.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;

import chinese.admin.domain.ChnArticlePraise;
/**
 * <p>数据访问类</p>
 * <p>Table: ChnArticlePraise</p>
 *
 */
 @DAO
public interface ChnArticlePraiseDAO {

	@SQL("SELECT * FROM ChnArticlePraise WHERE deleteFlag=1 LIMIT :t.start,:t.length")
	List<ChnArticlePraise> query(@SQLParam("t")ChnArticlePraise obj);

	@ReturnGeneratedKeys
	@SQL("INSERT INTO ChnArticlePraise(articleId,openId,ipAddr,deleteFlag,createAt,createUser,updateAt,updateUser) VALUES(:t.articleId,:t.openId,:t.ipAddr,:t.deleteFlag,:t.createAt,:t.createUser,:t.updateAt,:t.updateUser)")
	int create(@SQLParam("t")ChnArticlePraise obj);
	
	@SQL("UPDATE ChnArticlePraise SET articleId=:t.articleId,openId=:t.openId,ipAddr=:t.ipAddr,deleteFlag=:t.deleteFlag,createAt=:t.createAt,createUser=:t.createUser,updateAt=:t.updateAt,updateUser=:t.updateUser WHERE id=:t.id")
	void update(@SQLParam("t")ChnArticlePraise obj);
	
	@SQL("UPDATE ChnArticlePraise SET deleteFlag=1 WHERE id=:1")
	void delete(int id);

}